﻿# 注意文件格式，编码必须为UTF8-BOM
[CmdletBinding()]
# ===== 配置参数信息 =====
param(
    # 声明工作路径
    [string] $WorkDir = (Resolve-Path "${PSScriptRoot}\..").Path
)

# 对工作目录做绝对路径处理
$WorkDir = (Resolve-Path "$WorkDir").Path
# 创建pkgconfig目录
New-Item -Path "${WorkDir}\pkgconfig" -ItemType Directory -Force > $null

# 声明文件写入模板
$template1=@"
prefixDir=${WorkDir}
libDir=`${prefixDir}\lib
libName=maprule

Name: `${libName}
Description: Intelligent recognition model library by Graph AI
Version: 1.0
Libs: -L`${libDir} -l`${libName}
"@

# 写入文件
Set-Content -Value "$template1" -Path "${WorkDir}\pkgconfig\maprule.pc" -Encoding Ascii

# 声明文件写入模板
$template2=@"
prefixDir=${WorkDir}
libDir=`${prefixDir}\lib
libName=yoyoai

Name: `${libName}
Description: Intelligent recognition model library by Graph AI
Version: 1.0
Libs: -L`${libDir} -l`${libName}
"@

# 写入文件
Set-Content -Value "$template2" -Path "${WorkDir}\pkgconfig\yoyoai.pc" -Encoding Ascii
